{extend name="public:base" /}
{block name="breadcrumbs"}
<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>
						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								<a href="{:url('Index/index')}">首页</a>
							</li>
							<li class="active">资源管理</li>
						</ul><!-- .breadcrumb -->
					</div>
{/block}					
{block name="content"}
	<div class="page-header">	
		<a href="{:url('Sys/add')}">
				<button class="btn btn-xs btn-danger">
					<i class="icon-plus"></i>
					添加资源
				</button>
			</a>
	</div>
	<div class="row">
		<div class="col-xs-12">
			<div class="table-responsive">
											<table id="sample-table-1" class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th class="center">
															ID
														</th>
														<th>资源名称</th>
														<th>控制器/方法</th>
														<th class="hidden-480">状态</th>
														<th>排序</th>
														<th>操作</th>
													</tr>
												</thead>
												<tbody>
													
												{volist name="list" id="data"}
													<tr class="">
														<td class="center">
															{$data.id}
														</td>

														<td style="padding-left:{$data.leftspace}px">
															&nbsp;&nbsp;{$data.leftstr}{$data.title}
														</td>
														<td>{$data.name}</td>
														<td class="hidden-480">
															{eq name="data.status" value="1"}<span>开启</span>{/eq}
															{eq name="data.status" value="0"} <span style="color:red;">禁用</span>{/eq}
														</td>														
														<td>{$data.sort}</td>
														<td>
															<div class="hidden-sm hidden-xs action-buttons">
																<a class="blue" href="{:url('Sys/add',array('cid'=>$data['id']))}" title="添加子资源">																	
																		<i class="icon-plus bigger-120"></i>
																</a>
																<a class="green" href="{:url('Sys/edit',array('cid'=>$data['id']))}" title="修改资源">																	
																		<i class="icon-pencil bigger-120"></i>
																</a>
																<a class="red del" href="#" data="{$data.id}" title="删除资源">																	
																		<i class="icon-trash bigger-120"></i>
																</a>
															</div>

														</td>
													</tr>
													{/volist}

												</tbody>
											</table>
										</div>
		</div>
		<div class="col-xs-12"></div>
	</div>

{/block}
{block name="script"}
	<script type="text/javascript">
	$(".del").click(function(){	
		var idval=$(this).attr('data');
		layer.confirm('你确定要删除吗？',  function(){
			 $.post("{:url('sys/delete')}",
						{id:idval},
			 			function(d){
			 				layer.msg(d.msg,{icon:1});
			 				window.location.href="{:url('Sys/index')}";	
			 			});
			}, function(){
				window.location.href="{:url('Sys/index')}";	
			});
	});
	
	
	</script>
{/block}